﻿

using Azure.Toolkit.Azure;
using Microsoft.WindowsAzure.StorageClient;
using AzureFacebook.Domain;
namespace AzureFacebook.Data
{
    public class AddCommentCommand
    {
        const string PartitionKey = "HelloAzure";

        readonly TableRepository<CommentEntity> _commentRepository;
        public AddCommentCommand()
        {
            _commentRepository = new TableRepository<CommentEntity>();
        }

        public void Execute(Comment comment)
        {
            _commentRepository.Insert(comment.MapToTableData());
            _commentRepository.Commit();

        }
    }
}
